<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  <title>Banco de Internet</title>
  <link type="text/css" rel="stylesheet" href="<c:url value="/style.css"/>"/>

  <authz:authorize ifAllGranted="ROLE_USER">
    <script type='text/javascript'>
    </script>
  </authz:authorize>
</head>
<body>

  <h1>Internet Bank</h1>

  <div id="content">
    <h2>Inicio</h2>

    <p>Bienvenido a la página de acceso del Banco de Internet.</p>

    <authz:authorize ifNotGranted="ROLE_USER">
      <h2>Access</h2>
      <form action="<c:url value="/login.do"/>" method="POST">
        <p class="loginLabel"><label><input type='text' name='j_username' value="marissa"> User</label></p>
        <p class="loginLabel"><label><input type='text' name='j_password' value="koala"> Password</label></p>
        <p><input name="login" value="Acceder" type="submit"></p>
      </form>
    </authz:authorize>
    <authz:authorize ifAllGranted="ROLE_USER">
      <div style="text-align: center"><form action="<c:url value="/logout.do"/>"><input type="submit" value="Logout"></form></div>
      
      <h2>Authorization</h2>

    </authz:authorize>
  </div>

  <div id="footer">Design by <a href="http://www.gruposp2p.org" target="_blank">Energía y Red</a></div>

</body>
</html>